package com.HomeWorkhsp.Chapter07;

/**
 * Enjoy programming!!!
 * Time: 2021/11/8 -  20:36
 */
public class Test00 {
    public static void main(String[] args) {
        double[] a = {3.4, 5.2, 1.7, 2.2};
        A01 t = new A01();
        System.out.println(t.max(a));

    }

}

class A01 {
    public double max(double[] a) {
        double res = a[a.length - 1];
        for (int i = 0; i < a.length; i++) {
            if (res < a[i])
                res = a[i];
        }
        return res;

    }
}

